package studiodiva.portfolio.client.view;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.RootPanel;

import studiodiva.portfolio.client.lib.view.Layout;
import studiodiva.portfolio.client.lib.view.View;
import studiodiva.portfolio.client.model.HasApplication;

public class PortfolioBody extends View<FlowPanel> {

  interface Binder extends UiBinder<FlowPanel, PortfolioBody> {}

  private static Binder uiBinder = GWT.create(Binder.class);

  @UiField
  PortfolioWidget portfolioWidget;

  public PortfolioBody() {
    initWidget(uiBinder.createAndBindUi(this));
    Layout.heightAsParent(portfolioWidget);
  }

  @Override
  public void initialize(HasApplication hasApplication) {
    super.initialize(hasApplication);
    portfolioWidget.initialize(this);
  }

  public void show() {
    RootPanel.get().add(this);
  }
}
